package cnn.test.controller;

import cnn.test.service.UnitTestService;
import cnn.topfox.annotation.TokenOff;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/test")
public class UnitTestController {
    @Autowired
    UnitTestService unitTestService;

    @TokenOff
    @GetMapping
    public void query() {
        unitTestService.query();
        unitTestService.query1();
        unitTestService.query2();
    }

    @TokenOff
    @PostMapping
    public void insert() {
        unitTestService.insert();
    }

    @TokenOff
    @PutMapping
    public void update() {
        unitTestService.update();
        unitTestService.update1();
        unitTestService.updateList();
        unitTestService.updateBatch();
        unitTestService.findAndUpdate();
    }

    @TokenOff
    @PostMapping("/save")
    public void save() {
        unitTestService.saveTest();
    }
}
